package chapter05

object Test01_FunctionAndMethod {
  def main(args: Array[String]): Unit = {
    //定义函数
    def sayHi(name: String): Unit = println("hi, " + name)

    sayHi("alice")
    Test01_FunctionAndMethod.sayHi("alice")
    println(Test01_FunctionAndMethod.sayHello("alice"))
  }

  //定义对象的方法
  def sayHi(name: String): Unit = println("Hi, " + name)

  def sayHello(name: String): String = "Hello, " + name
}
